Repository navigation
feat(id-import-notion): row notes, property claims, relations (#13523 remainder) - #14358
Merged
Merged
Conversation
…remainder) Implements the #13523 remainder after PR #14026 (database-note identity + per-data-source schema claims): - New `rows` module: `convert_row` turns an inventoried row page into its design-§2.2 form — note identity, a typed reference to the database note, and property values recorded as claims interpreted against the schema of the data source the row was read from. A value whose type disagrees with its own source's schema, or that names a property the schema does not carry, fails the conversion closed (the §2.2 conflation guard). - Relations become typed references between row notes whose type is the relation's schema identity (data source, property) — never the parent database. One-way relations use their single pair; dual relations use the canonical unordered pair joined via `dual_property.synced_property_id`, stored sorted so both sides import as the one type. Values resolve only against rows of the schema's target data source; anything else is recorded as an externalised relation with its reason (outside-import-set / not-target-source-row) and counted. - Rollups and formulas become derived-value provenance claims (computed display value plus the verbatim definition, never silently-authoritative values); system properties (unique ID, created/last-edited time and by) become provenance claims; button/verification properties are named in the not-imported accounting instead of being imported as values. - Records persist in the manifest (`row_records`, serde-defaulted so older manifests still load), keyed by the row's page UUID and replaced wholesale on re-conversion, so an unchanged corpus reproduces identical artifacts. - content: `child_database` references now resolve their target note ID from the database identity pass, failing closed when an inventoried database has no assigned note ID; a database outside the import set keeps `None`. - Tests: 8 unit tests in `rows` plus a recorded-fixture test over the multi-source fixture database covering design §8 check 8's second half (every row's claims validate against its own source's schema and the colliding Status claim against no other; the relation defined in only one source produces references for rows of that source only) and the check-2 relation subset (each relation value is a typed reference or externalised with the expected reason). Full crate suite: 37 passed, 0 failed (`cargo test -p id-import-notion`, laptop `nix develop` in pkgs/id; this repo's CI runs on main only). Refs #13523. Remaining on the issue: §6.1 moved-source claim supersession, which belongs to the re-import driver — schema claims are conversion artifacts, not manifest state, today.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What landed
The #13523 remainder after PR #14026 (database-note identity + schema claims), per design #6436 §2.2/§3:
rowsmodule —convert_rowturns an inventoried row page into its §2.2 form: note identity, a typed reference to the database note, and property values recorded as claims interpreted against the schema of the data source the row was read from. A value whose type disagrees with its own source's schema, or that names a property the schema does not carry, fails closed (the conflation guard).dual_property.synced_property_id, stored sorted so both sides import as the one type. Values resolve only against rows of the schema's target data source; anything else is an externalised relation with its reason (outside_import_set/not_target_source_row), counted, never dropped.row_records(serde-defaulted; older manifests still load), keyed by page UUID, replaced wholesale on re-conversion.child_databasereferences now resolve their target note ID from the database identity pass (fail closed when an inventoried database has no assigned note ID).Tests
cargo test -p id-import-notion(laptop,nix developin pkgs/id — this repo's CI runs on main only): 37 passed, 0 failed. New coverage: 8 unit tests inrows(fail-closed validation, dual-relation canonical type shared by both sides, externalisation, claim forms, re-run idempotence) and a recorded-fixture test over the multi-source fixture database covering §8 check 8's second half and the check-2 relation subset. Clippy warnings on the crate are all pre-existing; none are in the new code.Remainder (issue stays open)
§6.1 moved-source claim supersession is not in this PR: it belongs to the re-import driver — schema claims are conversion artifacts, not manifest state, today, so there is no claim-history surface to supersede into yet. Recorded on #13523; queue task 23183 is released with that resume record.
Refs #13523
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-24T13:26:27Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": null, "model": null, "lane_start_issues": [], "workspace_ref": null, "auth_subject": "archer", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.